import { IsNotEmpty, IsString, IsNumber, IsOptional, Min } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class CreateDeptDto {
  @ApiProperty({ description: '部门名称' })
  @IsNotEmpty({ message: '部门名称不能为空' })
  @IsString()
  name: string;

  @ApiProperty({ description: '部门编号' })
  @IsNotEmpty({ message: '部门编号不能为空' })
  @IsString()
  code: string;

  @ApiProperty({ description: '父节点id', default: 0 })
  @IsNumber()
  @IsOptional()
  parent_id: number = 0;

  @ApiProperty({ description: '显示顺序', default: 0 })
  @IsNumber()
  @IsOptional()
  sort: number = 0;

  @ApiProperty({ description: '状态(1-正常 0-禁用)', default: 1 })
  @IsNumber()
  @IsOptional()
  status: number = 1;
}



